home *** CD-ROM | disk | FTP | other *** search
/ Aminet 24 / Aminet 24 (1998)(GTI - Schatztruhe)[!][Apr 1998].iso / Aminet / comm / bbs / Cit_Util_8B13.lha / Citadel_cimr.lha / cimr.doc < prev    next >
Text File  |  1997-08-21  |  9KB  |  253 lines

  1.     Citadel Internet Email Networking  Versin 7H21
  2.  
  3.     Introduction:
  4.  
  5. The utilties described in this archive are designed to simplify the
  6. processing of email network packets.  The pair of tools described here
  7. are designed to work with MSGADD, MSGOUT, and the freeware Amiga mailer
  8. YAM.
  9.  
  10. YAM is a TCP/IP POP3/SMTP tool that is freeware.  It maintainsn
  11. input, and output directories that these tools are compatible with.
  12. CIMR is not dependant on the mail tool.
  13.  
  14. Sending Mail Method:
  15.  
  16. Since many people have access to an Internet Service Provider (ISP) and can
  17. freely send email, it is logical that we extend that to Citadel Networking.
  18. If your familar with Fast Transfers, this method has alot of similarities.
  19.  
  20. First, arrange what rooms are being shared by this method, add the system
  21. to your node list and make it an OTHERNET system (Sysop Menu item).
  22.  
  23. Second, agree on a compression method (lha, zip, none, ect.) and make sure that
  24. your uuencode/uudecode tools are compatible.  I would suggest sending a
  25. few test files back and forth.  Make sure your have setup the same filenames.
  26. YAM will automatically uuencode or Mime encode your mail file for you.
  27.  
  28. Third and last, setup some scripts.  Included in the archive is a script
  29. that will shutdown Citadel, startup YAM and MIAMI(a TCP/IP stack), and do the
  30. mail processing using MSGOUT and MSGADD.  It will finish up by restarting
  31. Citadel.  The example is setup for two systems KRONOS and UNCENSORED, both
  32. currently use email networking with The Amiga Zone.
  33.  
  34. It is important that you identify the email, The subject is a good place
  35. to use since many mailers will filter out mail with a particular subject.
  36. YAM will easily filter based on subject.
  37.  
  38. CIMR will scan the mail directory for the subject( one of its arguments).
  39.  
  40. Sending:
  41.  
  42. To send network packets, you must shutdown Citadel, then run MSGOUT to
  43. extract the messages for the system in question.  The extracted file is then
  44. sent to YAM.  An example Rexx script would be:
  45.  
  46.  
  47. /**
  48.  Citadel Shutdown
  49. **/
  50. say "Shutting down Citadel if needed"
  51. OPTIONS RESULTS
  52. IF show('P','Citadel_68K') then DO
  53.    say "...Attempting Citadel shutdown"
  54.    ADDRESS "Citadel_68K"
  55.    "exit 1"
  56. END
  57. say "Done with Citadel shutdown"
  58. call delay(100)
  59.  
  60. /**
  61.  YAM Startup
  62. **/
  63. say "YAM Startup if needed"
  64. if ~show('P','YAM') then do
  65.     say "...Attempting to startup YAM"
  66.     address command 'run yam:yam nocheck'
  67.     call delay(100)
  68.     address command 'waitforport YAM'
  69.     if ~show('P','YAM') then do
  70.         say "......YAM startup failed!"
  71.         exit
  72.     end
  73. end
  74.  
  75. /**
  76.   Create a network packet
  77. **/
  78. /**
  79.   Now, we send a network packets, one to KRONOS, one to UNCENSORED
  80.   KRONOS needs a UUENCODED ZIP'ed message packet
  81.   The filename is 'amiga'
  82.   YAM folder 1 is the outgoing mail.
  83.   Note:  The Write* YAM ARexx commands require the quotes as they
  84.   are,  Otherwise ARexx will not send the command parameters correctly.
  85.   This is a part of how ARexx works, not a bug in YAM or this script.
  86. **/
  87. address command
  88. 'failat 100'
  89. 'delete amiga.zip amiga'
  90. 'msgout "Kronos" amiga'
  91. 'zip -q amiga.zip amiga'
  92. email    = 'cit-amiga@kronos.incentre.net'
  93. filename = 'cit:amiga.zip'
  94. address 'YAM'
  95. setfolder 1
  96. MailWrite
  97. WriteMailTo email
  98. 'WriteSubject "The Amiga Zone US (609) 953-8159"'
  99. WriteAttach filename '"Email_Network_Packet" "UU" "application/octet-stream"'
  100. WriteQueue
  101. address command
  102. 'delete cit:amiga.zip'
  103.  
  104. /**
  105.   Create a network packet for UNCENSORED
  106.   This system wanted an uncompressed file, uuencoded.
  107. **/
  108. say "Creating the packet for UNCENSORED"
  109. address command
  110. 'failat 100'
  111. 'delete uncensored.zip uncensored'
  112. 'msgout "uncensored" uncensored'
  113. email = 'cit86net@uncnsrd.mt-kisco.ny.us'
  114. filename = 'cit:uncensored'
  115. say "Queueing the packet for UNCENSORED"
  116. address 'YAM'
  117. setfolder 1
  118. MailWrite
  119. WriteMailTo email
  120. 'WriteSubject "US6099538159"'
  121. WriteAttach filename '"Email_Network_Packet" "UU" "application/octet-stream"'
  122. WriteQueue
  123. address command
  124.  
  125. These commands do not require that Miami (or whatever TCP/IP stack you use )
  126. is online.  YAM will queue the mail for later processing when online.   If
  127. you wished to send the mail now, you could add the following:
  128.  
  129. /**
  130.   Startup Miami if needed.
  131. **/
  132. say "Miami startup if needed"
  133. if ~show('P','MIAMI.1') then do
  134.     say "...Starting up Miami"
  135.     address command 'run miami:miami'
  136.     call delay(100)
  137.     address command 'waitforport MIAMI.1'
  138.     if ~show('P','MIAMI.1') then do
  139.         say "......Couldn't run MIAMI,  Aborting!"
  140.         exit
  141.     end
  142. end
  143. /**
  144.   Go online, your Miami defaults will do their work.
  145. **/
  146. say "Make sure we are online"
  147. address 'MIAMI.1'           /* Miami is up and running now...*/
  148. 'HIDE'
  149. 'ISONLINE'
  150. if rc = 0 then do
  151.    say "... Not online, attempting to connect"
  152.    do i=0 to 5
  153.      'ONLINE'        /* Go online */
  154.      'ISONLINE'      /* Did it succeed ? */
  155.      if rc = 1 then leave /* exit loop if online */
  156.    end
  157.    'ISONLINE'
  158.    if rc = 0 then do
  159.      say "......Unable to get online, Mail will be processed next time!"
  160.    end
  161. end
  162.  
  163. /**
  164.   Get Mail, Filter it, Process mail (the filter selects our network
  165.   packets), Send Mail.
  166. **/
  167. Address YAM
  168. MailCheck     /* Get new mail */
  169.  
  170. if rc = -1 then
  171.   say "YAM: connection to mail server has failed, could not get new mail"
  172.  
  173. MailFilter    /* Filter, it   */
  174. MailSendAll   /* Send all queued mail   */
  175. if rc = -1 then
  176.   say "YAM: connection to mail server has failed, could not send new mail"
  177.  
  178.  
  179.  
  180. Recieving Mail Method:
  181.  
  182.  The processing to recieve mail is more complex than sending.  When sending
  183.  you are doing one system, one time.  With recieving, you may get multiple
  184.  packets from the same system.  The following script takes this into account
  185.  by looping until there are no more mail messages.  Also important is to set
  186.  the "fail" point to beyond 20.  The script sets it mine to 30.
  187.  
  188.  YAM (as most mailers) keeps your mail in a folder which is a directory. You
  189.  must identify the proper directory for your archived network packets.  If
  190.  you look at the file YAM:.config, you should be able to figure out what this
  191.  directory is.
  192.  
  193.  CIMR runs with 4 parameter, the mail directory, the subject to scan for,
  194.  and the filename to deposit the uuencoded file from the mail message and
  195.  an indicator which is either "remove" or "save".  "remove" will delete the
  196.  mail out of the queue, this is the normal operation.  I included a "save"
  197.  option for two reason.  One, is testing, if your testing, use save and the
  198.  mail packet will reused over and over again.  This is good for debugging
  199.  your scripts since MSGADD will detect the second time as vortex messages
  200.  and not add them to the Citadel Message Base.  The other reason is if your
  201.  Mail tool keeps track of all mail and only wants you to delete mail from
  202.  the tool, you will have to manually delete the mail.  With YAM, you can
  203.  use remove so long as you update the folders afterwards(See the example
  204.  script).
  205.  
  206.  CIMR will return an error if any of the parameters are invalid(like the
  207.  directory name, or if it cannot create the file specified.
  208.  
  209.  Note:  Parameter 4, the filename can be anyname.  Just make sure that you
  210.  check for the right filename in your scripts.
  211.  
  212.  
  213. failat 30
  214. delete t:temp
  215. ;
  216. ; loop until there are no more message packets to process
  217. ;
  218. LAB LOOP1
  219. cimr yam:archive1/#? "AmigaZone" t:temp remove
  220. if ERROR
  221.   echo "Error processing mail for KRONOS, exiting"
  222. else
  223.   if exists t:temp
  224.     uudecode t:temp
  225.     unzip -o -q kronos.zip
  226.     msgadd "Kronos" Kronos
  227.     delete t:temp
  228.     delete Kronos.zip
  229.     skip LOOP1 back
  230.   else
  231.     echo "Finished mail processing from Kronos"
  232.   endif
  233. endif
  234.  
  235. A couple of key points... You might want to save the message packet (see
  236. the tool save_file, see below ) for later.  The reason is that if there
  237. are any problems, you may want to resend, or at least debug the problem and
  238. having the old packets helps.  I save all packets, both the sent and recieved
  239. for several days.  CIMR only works with uuencoded files at this point.  The
  240. last point is that yam:archive1/#? is where I filter my network packets for
  241. Kronos.  I setup one archive directory for each system I net with.
  242.  
  243. If you have any questions, feel free to contact me via Citadel or email.
  244.  
  245.  
  246. save_file
  247.  
  248. This is a handly little tool that wil